<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>


<div>

    <div>
        <input type="text" id="text">
    </div>

    <div>
        A<input type="checkbox" value="A" onclick="method(this)">
        B<input type="checkbox" value="B" onclick="method(this)">
        C<input type="checkbox" value="C" onclick="method(this)">
    </div>

</div>

</body>
<script>
    var elementById = document.getElementById("text");

    function method(obj) {
        var value = elementById.value;
        if (obj.checked) {
            elementById.value = value + obj.value;
        } else {
            var arr = value.split("");
            value = "";
            for (var i = 0; i < arr.length; i++) {
                if (arr[i] == obj.value) {
                    continue;
                }
                value += arr[i];
            }
            elementById.value = value;
        }
    }

</script>
</html>